|
|
|
|
|
|
|
Setting the DataSource property of the textbox control binds the input control to the data control. To set the textbox DataSource property, first select the textbox control (click it once), and then click the DataSource property in the Property window. By clicking this property's down arrow, you can see a list of all the data controls currently active on this form. You have only added one data control to this form, so you see only one name in the list (see Figure 1.5). Set the DataSource value to datTitles by clicking the word datTitles in the drop-down list box. |
|
|
|
|
|
|
|
|
Figure 1.5.
Setting the DataSource
property of a bound textbox. |
|
|
|
|
|
|
|
|
The second required property for a bound input control is the DataField property. Setting this property binds a specific field in the data table to the input control. Set the DataField property of the current input control by single-clicking the DataField property in the Property window and then single-clicking the down arrow to the right of the property. You now see a list of all the fields that are defined for the data table that you selected in the DataSource property (see Figure 1.6). Click the Title field to set the DataField property for this control. |
|
|
|
|
|
|
|
|
Figure 1.6.
Selecting the DataField property
of the bound textbox control. |
|
|
|
|
|